<template>
  <div class="contentDiv">
    <div>
      <div>子</div>
      {{ customVal.name }}
      {{ ageChild }}
      <grandson/>
    </div>
  </div>
</template>

<script setup>
import { onMounted, ref, inject,provide } from "vue";
import grandson from "./grandson.vue";
const customVal = inject("customVal");
const ageChild = inject("age");
provide("ageChild", ageChild);
const change = () => {
  setTimeout(() => {
    customVal.value.name = "小吴";
    ageChild.value = 80;
    // $emit('changeValue', "小吴")
  }, 6000);
};
change();
</script>

<style lang="scss" scoped></style>
